import java.util.Scanner;

public class MethodTest3 {
    public static void main(String[] args) {
       int[] arr={1,2,3,4,5};
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个整数:");
        int num=sc.nextInt();
        System.out.println("整数存在吗?"+getExisit(num,arr));


    }
    public static boolean getExisit(int num,int[] arr){

        for (int i = 0; i < arr.length; i++) {
            if(num==arr[i]){
                 return true;
            }
        }
        return false;
    }
}
